<?php
defined('IN_APP') or die('Access Denied');
class Common_Excpetion extends Exception
{
    public function getText()
    {
        return $this->getCode().'|'.$this->getMessage().".\n";
    }
}
function myExceptionHandler($e)
{
    echo "<b>Exception:</b> ", $e->getCode() , '|', $e->getMessage(), "<br/>";
    echo "Backtree: <pre>";
    var_export(debug_backtrace());
    echo "</pre>";
}
set_exception_handler('myExceptionHandler');